import request from '@/utils/request';
import { stringify } from 'qs';
import { getPageSize } from '@/utils/common';
import { async } from 'q';

export const token = localStorage.getItem('token');
export const user = localStorage.getItem('user') ? JSON.parse(localStorage.getItem('user')) : {};

/**
 * 查询订单管理列表
 */
export async function selectKNTracks(params) {
  params.pageSize = params.pageSize || getPageSize();
  return request(`/server/api/track-order/selectKangNingTracks`, {
    method: 'POST',
    body: params,
  });
}
// 地图轨迹
export async function selectMapTracks(params) {
  return request(`/server/api/track-order/selectTrackByOrderNoUrl`, {
    method: 'POST',
    body: params,
  });
}

//获取节点跟踪：
export async function getTracking(params) {
  const { ids,type } = params;
  let url=type?'insideSelectOrderInfo':'externalSelectOrderInfo'
  return request(
    // `/server/api/api/OCS/Order/GetTracking`, 
   // POST /API/OCS/Order/OrderTracking
    `/server/api/track-order/${url}`,
    {
      method: 'POST',
      body: params,
    },
    true
  );
}
